#-*- coding:UTF-8 -*-
def longestCommonPrefix(self, strs):
    # write your code here
    a=''
    if strs==None or len(strs)==0:
        return a
    a=strs[0]
    if len(strs)==1:
        return a
    for i in strs:
        j=0
        while j<len(a) and j<len(i) and a[j]==i[j]:
            j+=1
        if j==0:
            return ""
        a=a[0:j]
    return a

print longestCommonPrefix('',['abc','abcd','abcdef'])
